package com.gao.autoconfigdemo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

/**
 * spring.factories 可以指定某个类加载到项目的运行容器中
 * @Bean 的方法不一定在@Configuration类中。@Controller @Component 都可以
 */
@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan
public class AutoconfigDemoApplication {

    @Autowired
    private TestBean testBean;

    public static void main(String[] args) {
        SpringApplication.run(AutoconfigDemoApplication.class, args);
    }

}
